package com.zhx.ad.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhx.ad.entity.AdCreative;
import com.zhx.ad.mapper.AdCreativcMapper;
import com.zhx.ad.service.IAdCreativeService;
import com.zhx.ad.client.vo.CreativeRequest;
import com.zhx.ad.client.vo.CreativeResponse;
import org.springframework.stereotype.Service;

/**
 *describe: 
 *
 *@author zhanghaixuan
 *@date 2019/02/02
 **/
@Service
public class AdCreativeServiceImpl extends ServiceImpl<AdCreativcMapper, AdCreative> implements IAdCreativeService {


	@Override
	public CreativeResponse createCreative(CreativeRequest request) {

		baseMapper.insert(
				request.convertToEntity()
		);

		return new CreativeResponse(request.convertToEntity().getId(), request.convertToEntity().getName());
	}
}
